﻿using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Application;
using Volo.Abp.AspNetCore.Components.Web;
using Volo.Abp.Authorization;
using Volo.Abp.Modularity;

namespace Allin.Abp.AntDesignUI;

[DependsOn(
typeof(AbpAspNetCoreComponentsWebModule),
typeof(AbpDddApplicationContractsModule),
typeof(AbpAuthorizationModule)
)]
public class AbpAntDesignUIModule : AbpModule
{
    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        ConfigureAntDesign(context);
    }

    private void ConfigureAntDesign(ServiceConfigurationContext context)
    {
        context.Services.AddAntDesign();
        //context.Services.AddBlazorise(options =>
        //{
        //    options.Debounce = true;
        //    options.DebounceInterval = 800;
        //});

        //context.Services.Replace(ServiceDescriptor.Scoped<IComponentActivator, ComponentActivator>());
        context.Services.AddSingleton(typeof(AbpBlazorMessageLocalizerHelper<>));
    }
}

